場景管理API
獲取場景列表
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | []Object<result> | Body | 返回結果 |
result說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| scene_id | String | Body | 場景ID |
| scene_name | String | Body | 場景名稱 |
| is_auto | Boolean | Body | 判斷是否可以自動化 true:是 false:否 |
| enable_auto | Boolean | Body | 判斷是否啓用自動化 true:啓用 false:禁用 |
| manual | Boolean | Body | 判斷是否可以手動觸發 true:是 false:否 |
| scene_entity_id | String | Body | 場景實體ID |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_scene_list",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db",
"scene_name": "my scene",
"is_auto": true,
"enable_auto": true,
"manual": true,
"scene_entity_id": "es8b5a73f8dd84abaa94dcs248be49b0d2"
}
]
}
失敗返回示例
見 接口失敗返回
獲取場景信息
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scene_id | String | Body | 是 | 場景ID |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object<result> | Body | 返回結果 |
result說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| scene_name | String | Body | 場景名稱 |
| is_auto | Boolean | Body | 判斷是否可以自動化 true:是 false:否 |
| manual | Boolean | Body | 判斷是否可以手動觸發 true:是 false:否 |
| scene_entity_id | String | Body | 場景實體ID |
| triggers | []Object<trigger> | Body | 觸發器信息 |
| conditions | []Object<condition> | Body | 條件信息 |
| actions | []Object<action> | Body | 動作信息 |
trigger說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| trigger_config | String | Body | 觸發器配置,見 場景觸發器配置 |
| device_id | String | Body | 設備ID |
| ability_id | String | Body | 能力ID |
| ability_type | String | Body | 能力類型 |
| trigger_type | String | Body | 觸發器類型,見 場景觸發器配置 |
| attribute | Object | Body | 附加屬性,見 標準物模型 |
condition說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| condition_config | String | Body | 條件配置,見 場景條件配置 |
| device_id | String | Body | 設備ID |
| ability_id | String | Body | 能力ID |
| ability_type | String | Body | 能力類型 |
| condition_type | String | Body | 條件類型,見 場景條件配置 |
| attribute | Object | Body | 附加屬性,見 標準物模型 |
action說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| action_config | String | Body | 動作配置,見 場景動作配置 |
| device_id | String | Body | 設備ID |
| ability_id | String | Body | 能力ID |
| ability_type | String | Body | 能力類型 |
| action_type | String | Body | 動作類型,見 場景動作配置 |
| attribute | Object | Body | 附加屬性,見 標準物模型 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"scene_name": "my scene",
"is_auto": true,
"manual": true,
"scene_entity_id": "es8b5a73f8dd84abaa94dcs248be49b0d2",
"triggers": [
{
"trigger_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea1",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec1",
"ability_type": "switch",
"trigger_type": "turned_on"
}
],
"conditions": [
{
"condition_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea2",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec2",
"ability_type": "switch",
"condition_type": "is_on"
}
],
"actions": [
{
"action_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea3",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec3",
"ability_type": "switch",
"action_type": "turn_on"
}
]
}
]
}
失敗返回示例
見 接口失敗返回
獲取設備觸發器列表
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| device_id | String | Body | 否 | 設備ID |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | []Object<result> | Body | 返回結果 |
result說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| device_name | String | Body | 設備名稱 |
| device_type | String | Body | 設備類型 |
| device_id | String | Body | 設備ID |
| triggers | []Object<trigger> | Body | 觸發器信息 |
trigger說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| trigger_config | String | Body | 觸發器配置,見 場景觸發器配置 |
| device_id | String | Body | 設備ID |
| ability_id | String | Body | 能力ID |
| ability_type | String | Body | 能力類型 |
| trigger_type | String | Body | 觸發器類型,見 場景觸發器配置 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_device_trigger_list",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"device_name": "My Device",
"device_type": "Switch",
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"triggers": [
{
"trigger_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec7",
"ability_type": "switch",
"trigger_type": "turned_on"
}
]
}
]
}
失敗返回示例
見 接口失敗返回
獲取設備條件列表
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| device_id | String | Body | 否 | 設備ID |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | []Object<result> | Body | 返回結果 |
result說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| device_name | String | Body | 設備名稱 |
| device_type | String | Body | 設備類型 |
| device_id | String | Body | 設備ID |
| conditions | []Object<condition> | Body | 條件信息 |
condition說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| condition_config | String | Body | 條件配置,見 場景條件配置 |
| device_id | String | Body | 設備ID |
| ability_id | String | Body | 能力ID |
| ability_type | String | Body | 能力類型 |
| condition_type | String | Body | 條件類型,見 場景條件配置 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_device_condition_list",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"device_name": "My Device",
"device_type": "Switch",
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"conditions": [
{
"condition_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec7",
"ability_type": "switch",
"condition_type": "is_on"
}
]
}
]
}
失敗返回示例
見 接口失敗返回
獲取設備動作列表
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| device_id | String | Body | 否 | 設備ID |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | []Object<result> | Body | 返回結果 |
result說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| device_name | String | Body | 設備名稱 |
| device_type | String | Body | 設備類型 |
| device_id | String | Body | 設備ID |
| actions | []Object<action> | Body | 動作信息 |
action說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| action_config | String | Body | 動作配置,見 場景動作配置 |
| device_id | String | Body | 設備ID |
| ability_id | String | Body | 能力ID |
| ability_type | String | Body | 能力類型 |
| action_type | String | Body | 動作類型,見 場景動作配置 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_device_action_list",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"device_name": "My Device",
"device_type": "Switch",
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"actions": [
{
"action_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aeaf",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec7",
"ability_type": "switch",
"action_type": "turn_on"
}
]
}
]
}
失敗返回示例
見 接口失敗返回
創建場景信息
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scene_name | String | Body | 是 | 場景名稱 |
| manual | Boolean | Body | 是 | 判斷是否可以手動觸發 true:是 false:否 |
| triggers | []Object<trigger> | Body | 是 | 觸發器信息 |
| conditions | []Object<condition> | Body | 是 | 條件信息 |
| actions | []Object<action> | Body | 是 | 動作信息 |
trigger說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| trigger_config | String | Body | 是 | 觸發器配置,見 場景觸發器配置 |
| device_id | String | Body | 否 | 設備ID |
| ability_id | String | Body | 否 | 能力ID |
| ability_type | String | Body | 否 | 能力類型 |
| trigger_type | String | Body | 否 | 觸發器類型,見 場景觸發器配置 |
| attribute | Object | Body | 否 | 附加屬性,見 標準物模型 |
condition說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| condition_config | String | Body | 是 | 條件配置,見 場景條件配置 |
| device_id | String | Body | 否 | 設備ID |
| ability_id | String | Body | 否 | 能力ID |
| ability_type | String | Body | 否 | 能力類型 |
| condition_type | String | Body | 否 | 條件類型,見 場景條件配置 |
| attribute | Object | Body | 否 | 附加屬性,見 標準物模型 |
action說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| action_config | String | Body | 是 | 動作配置,見 場景動作配置 |
| device_id | String | Body | 否 | 設備ID |
| ability_id | String | Body | 否 | 能力ID |
| ability_type | String | Body | 否 | 能力類型 |
| action_type | String | Body | 否 | 動作類型,見 場景動作配置 |
| attribute | Object | Body | 否 | 附加屬性,見 標準物模型 |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object | Body | 返回結果 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "create_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"scene_name": "test",
"manual": true,
"triggers": [
{
"trigger_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea1",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec1",
"ability_type": "switch",
"trigger_type": "turned_on"
}
],
"conditions": [
{
"condition_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea2",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec2",
"ability_type": "switch",
"condition_type": "is_on"
}
],
"actions": [
{
"action_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea3",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec3",
"ability_type": "switch",
"action_type": "turn_on"
}
]
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失敗返回示例
見 接口失敗返回
更新場景信息
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scene_id | String | Body | 是 | 場景ID |
| scene_name | String | Body | 是 | 場景名稱 |
| manual | Boolean | Body | 是 | 判斷是否可以手動觸發 true:是 false:否 |
| triggers | []Object<trigger> | Body | 是 | 觸發器信息 |
| conditions | []Object<condition> | Body | 是 | 條件信息 |
| actions | []Object<action> | Body | 是 | 動作信息 |
trigger說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| trigger_config | String | Body | 是 | 觸發器配置,見 場景觸發器配置 |
| device_id | String | Body | 否 | 設備ID |
| ability_id | String | Body | 否 | 能力ID |
| ability_type | String | Body | 否 | 能力類型 |
| trigger_type | String | Body | 否 | 觸發器類型,見 場景觸發器配置 |
| attribute | Object | Body | 否 | 附加屬性,見 標準物模型 |
condition說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| condition_config | String | Body | 是 | 條件配置,見 場景條件配置 |
| device_id | String | Body | 否 | 設備ID |
| ability_id | String | Body | 否 | 能力ID |
| ability_type | String | Body | 否 | 能力類型 |
| condition_type | String | Body | 否 | 條件類型,見 場景條件配置 |
| attribute | Object | Body | 否 | 附加屬性,見 標準物模型 |
action說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| action_config | String | Body | 是 | 動作配置,見 場景動作配置 |
| device_id | String | Body | 否 | 設備ID |
| ability_id | String | Body | 否 | 能力ID |
| ability_type | String | Body | 否 | 能力類型 |
| action_type | String | Body | 否 | 動作類型,見 場景動作配置 |
| attribute | Object | Body | 否 | 附加屬性,見 標準物模型 |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object | Body | 返回結果 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "update_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"scene_id": "sr31adc223cc4b3bedb6bd4742dedcfa5",
"manual": true,
"scene_name": "test",
"triggers": [
{
"trigger_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea1",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec1",
"ability_type": "switch",
"trigger_type": "turned_on"
}
],
"conditions": [
{
"condition_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea2",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec2",
"ability_type": "switch",
"condition_type": "is_on"
}
],
"actions": [
{
"action_config": "device",
"device_id": "da59adf952f19dc69b82868e9c4f6aea3",
"ability_id": "ec2dab6d92b8755a9f59b5611f0fa1ec3",
"ability_type": "switch",
"action_type": "turn_on"
}
]
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失敗返回示例
見 接口失敗返回
刪除場景信息
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scene_id | String | Body | 是 | 場景ID |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object | Body | 返回結果 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "delete_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失敗返回示例
見 接口失敗返回
批量刪除場景信息
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scenes | []Object<scene> | Body | 是 | 場景信息 |
scene說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| scene_id | String | Body | 是 | 場景ID |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object | Body | 返回結果 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "batch_delete_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"scenes": [
{
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db"
}
]
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失敗返回示例
見 接口失敗返回
手動觸發場景
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| scene_entity_id | String | Body | 是 | 場景實體ID |
| residence_id | String | Body | 是 | 住宅ID |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object | Body | 返回結果 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "manual_trigger_scene",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_entity_id": "e3b5a73f8dd84abaa94dcs248be49b0db",
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失敗返回示例
見 接口失敗返回
批量手動觸發場景
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scenes | []Object<scene> | Body | 是 | 場景信息 |
scene說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| scene_entity_id | String | Body | 是 | 場景實體ID |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object | Body | 返回結果 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "batch_manual_trigger_scene",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scenes": [
{
"scene_entity_id": "e3b5a73f8dd84abaa94dcs248be49b0db"
}
],
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失敗返回示例
見 接口失敗返回
啓用自動化場景
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| scene_entity_id | String | Body | 是 | 場景實體ID |
| residence_id | String | Body | 是 | 住宅ID |
| enable_auto | Boolean | Body | 是 | 判斷是否啓用自動化 true:啓用 false:禁用 |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object | Body | 返回結果 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "enable_auto_scene",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_entity_id": "e3b5a73f8dd84abaa94dcs248be49b0db",
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"enable_auto": true
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失敗返回示例
見 接口失敗返回
批量啓用自動化場景
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scenes | []Object<scene> | Body | 是 | 場景信息 |
scene說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| scene_entity_id | String | Body | 是 | 場景實體ID |
| enable_auto | Boolean | Body | 是 | 判斷是否啓用自動化 true:啓用 false:禁用 |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object | Body | 返回結果 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "batch_enable_auto_scene",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scenes": [
{
"scene_entity_id": "e3b5a73f8dd84abaa94dcs248be49b0db",
"enable_auto": true
}
],
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失敗返回示例
見 接口失敗返回
獲取場景歷史記錄
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| scene_id | String | Body | 是 | 場景ID |
| page_size | Integer | Body | 是 | 每頁數量 |
| page_index | Integer | Body | 是 | 當前頁數 |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | []Object<result> | Body | 返回結果 |
result說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| scene_record_id | String | Body | 場景記錄ID |
| scene_id | String | Body | 場景ID |
| scene_name | String | Body | 場景名稱 |
| trigger_scene | Boolean | Body | 判斷場景執行是否成功 true:成功 false:失敗 |
| start_time | String | Body | 開始時間,UTC |
| finish_time | String | Body | 結束時間,UTC |
| manual | Boolean | Body | 判斷是否是手動觸發 true:是 false:否 |
| detail | Object<detail> | Body | 詳細信息 |
detail說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| space_name | String | Body | 空間名稱 |
| space_id | String | Body | 空間ID |
| device_name | String | Body | 設備名稱 |
| device_id | String | Body | 設備ID |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_scene_history",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"page_size": 1,
"page_index": 1,
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db",
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"scene_record_id": "r8b5a73f8dd84abaa94dcs248be49b0d1",
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db",
"scene_name": "my scene",
"trigger_scene": true,
"start_time": "2024-01-16 13:32:43",
"finish_time": "2024-01-16 13:32:45",
"manual": false,
"detail": {
"space_name": "kitchen",
"space_id": "ss8b5a73f8dd84abaa94dcs248be49b0d",
"device_name": "co",
"device_id": "dr8b5a73f8dd84abaa94dcs248be49b0d"
}
}
]
}
失敗返回示例
見 接口失敗返回
刪除場景歷史記錄
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| scene_record_id | String | Body | 是 | 場景記錄ID |
| residence_id | String | Body | 是 | 住宅ID |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object | Body | 返回結果 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "delete_scene_history",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_record_id": "r7b5a73f8dd84abaa94dcs248be49b5dh",
"residence_id": "r4b5a73f8dd84abaa94dcs248be49b0db"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失敗返回示例
見 接口失敗返回
批量刪除場景歷史記錄
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| scene_records | []Object<scene_record> | Body | 是 | 場景記錄信息 |
| residence_id | String | Body | 是 | 住宅ID |
scene_record說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| scene_record_id | String | Body | 是 | 場景記錄ID |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object | Body | 返回結果 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "batch_delete_scene_history",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_records": [
{
"scene_record_id": "r7b5a73f8dd84abaa94dcs248be49b5dh"
}
],
"residence_id": "r4b5a73f8dd84abaa94dcs248be49b0db"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失敗返回示例
見 接口失敗返回